/*
	Name:
	Copyright:
	Author:
	Date: 
	Description:
*/
#include <stdio.h>
#include <string.h>


int main(){
	char s1[10000],s2[10000];
	int match=0,place=0;
	//scanf("%s",&s1); 
	//scanf("%s",&s2);
	//printf("%s\n%s",s1,s2);
	gets(s1);
	gets(s2);
	char *ts2=s2;
	int len_s1=strlen(s1);
	while(*ts2){
		/*if (*s1==*ts2)
			match+=(strncmp(s1,ts2,len_s1)==0);
		*/
		
		if (*s1==*ts2&&(strncmp(s1,ts2,len_s1)==0)) {
			match++;
			printf("%d ",place);
			
		}
		ts2++;
		place++;
		
	}
	if(match==0)
	printf("-1");
	//printf("%d",match);
	return 0;
}


